import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  // 首页
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/home/index.vue')
  },
  // 视频详情
  {
    path: '/video',
    name: 'Video',
    component: () => import('@/views/video/index.vue')
  },
  // 视频上传
  {
    path: '/upload',
    name: 'Upload',
    component: () => import('@/views/upload/index.vue')
  },
  // 视频管理
  {
    path: '/manage',
    name: 'Manage',
    component: () => import('@/views/manage/index.vue')
  },
  // 忘记密码
  {
    path: '/forgotPassword',
    name: 'ForgotPassword',
    component: () => import('@/views/forgotPassword/index.vue')
  },
  // 修改密码
  {
    path: '/modifyPassword',
    name: 'ModifyPassword',
    component: () => import('@/views/modifyPassword/index.vue')
  },
  // 注册
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/register/index.vue')
  },
  // 私信
  {
    path: '/message',
    name: 'Message',
    component: () => import('@/views/messages/index.vue')
  },
  // 订阅
  {
    path: '/subscriptions',
    name: 'Subscriptions',
    component: () => import('@/views/subscriptions/index.vue')
  },
  // 收藏
  {
    path: '/favorites',
    name: 'Favorites',
    component: () => import('@/views/favorites/index.vue')
  },
  // 历史记录
  {
    path: '/history',
    name: 'History',
    component: () => import('@/views/history/index.vue')
  },
  // 用户主页
  {
    path: '/profile',
    name: 'Profile',
    component: () => import('@/views/profile/index.vue')
  },
  // 菜单
  {
    path: '/menu',
    name: 'Menu',
    component: () => import('@/views/menu/index.vue')
  },
  // 搜索
  {
    path: '/search',
    name: 'Search',
    component: () => import('@/views/search/index.vue')
  },
  // 404
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/views/notFound/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
